<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改养修服务单项')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-customer-edit" th:object="${serviceItem}">
        <input id="id" name="id" type="hidden" th:field="*{id}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">服务项名称 ：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="name" id="name" th:field="*{name}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">服务项原价 ：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="name" id="originalPrice" th:field="*{originalPrice}"
                       required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">服务项折扣价 ：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="name" id="discountPrice" th:field="*{discountPrice}"
                       required>
            </div>
        </div>
        <!--<div class="form-group">

            <div class="col-sm-8">
                <select name="serviceCatalog" th:with="type=${@dict.getType('si_service_catalog')}" class="form-control" >
                    <option value="">所有</option>
                    <option th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}"></option>
                </select>
            </div>
        </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">服务项分类 ：</label>
            <div class="col-sm-8">
                <select name="serviceCatalog" class="form-control" th:with="type=${@dict.getType('si_service_catalog')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                            th:field="*{serviceCatalog}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">备注信息 ：</label>
            <div class="col-sm-8">
                <textarea id="info" name="info" class="form-control" th:field="*{info}"></textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script type="text/javascript">
    var ctx = "http://localhost";
    var prefix = ctx + "/business/serviceItem";

    // $("#form-customer-edit").validate({
    // 	onkeyup: false,
    // 	rules:{
    // 		name:{
    // 			remote: {
    //                 url: prefix + "/checkCustomerNameUnique",
    //                 type: "customer",
    //                 dataType: "json",
    //                 data: {
    //                 	"id": function() {
    // 					    return $("input[name='id']").val();
    // 					},
    //                 	"name" : function() {
    //                         return $.common.trim($("#customerName").val());
    //                     }
    //                 },
    //                 dataFilter: function(data, type) {
    //                 	return $.validate.unique(data);
    //                 }
    //             }
    // 		},
    // 		code:{
    // 			remote: {
    //                 url: prefix + "/checkCustomerCodeUnique",
    //                 type: "customer",
    //                 dataType: "json",
    //                 data: {
    //                 	"id": function() {
    // 					    return $("input[name='id']").val();
    // 					},
    //                 	"code" : function() {
    //                 		return $.common.trim($("#customerCode").val());
    //                     }
    //                 },
    //                 dataFilter: function(data, type) {
    //                 	return $.validate.unique(data);
    //                 }
    //             }
    // 		},
    // 		seq:{
    // 			digits:true
    // 		},
    // 	},
    // 	messages: {
    //         "code": {
    //             remote: "客户编码已经存在"
    //         },
    //         "name": {
    //             remote: "客户名称已经存在"
    //         }
    //     },
    //     focusCleanup: true
    // });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-customer-edit').serialize());
        }
    }
</script>
</body>
</html>
